package com.luna.servlets;

import com.luna.beans.Phase;
import com.luna.service.NoteService;
import com.luna.service.PhaseService;
import com.luna.serviceImpl.NoteServiceImpl;
import com.luna.serviceImpl.PhaseServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(
        name = "RemoveNote",
        urlPatterns = "/RemoveNote"
)
public class RemoveNote extends HttpServlet {

    public RemoveNote() {}

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        NoteService noteService = new NoteServiceImpl();
        int note_id = Integer.parseInt(req.getParameter("note_id"));
        noteService.dropNote(note_id);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doGet(req, resp);
    }
}
